<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-purchase-edit" th:object="${tPurchase}">
        <input name="purchaseId" th:field="*{purchaseId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">姓名：</label>
            <div class="col-sm-8">
                <input name="purchaseName" th:field="*{purchaseName}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">身份证号：</label>
            <div class="col-sm-8">
                <input name="purchaseCid" th:field="*{purchaseCid}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别：</label>
            <div class="col-sm-8">
                <select name="purchaseSex" th:with="type=${@dict.getType('sys_user_sex')}" class="form-control">
                    <option selected hidden value="">-请选择-</option>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:value="${dict.dictValue}" th:field="*{purchaseSex}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">手机号：</label>
            <div class="col-sm-8">
                <input name="purchasePhone" th:field="*{purchasePhone}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">住址：</label>
            <div class="col-sm-8">
                <input name="purchaseAddress" th:field="*{purchaseAddress}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input name="purchaseRemarks" th:field="*{purchaseRemarks}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否加入黑名单：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_purchase_flag')}">
                    <input type="radio" th:id="${dict.dictCode}" name="flag" th:value="${dict.dictValue}" th:checked="${dict.default}" th:field="*{flag}">
                    <label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/purchase";
    $("#form-purchase-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-purchase-edit').serialize());
        }
    }
</script>
</body>
</html>